/**  
* Copyright (c) 2008, Noel Lynch All rights reserved. Redistribution and use  
* in source and binary forms, with or without modification, are permitted  
* provided that the following conditions are met: Redistributions of source  
* code must retain the above copyright notice, this list of conditions and the  
* following disclaimer. Redistributions in binary form must reproduce the above  
* copyright notice, this list of conditions and the following disclaimer in the  
* documentation and/or other materials provided with the distribution. Neither  
* the name of Noel Lynch nor the names of contributors may be used to  
* endorse or promote products derived from this software without specific prior  
* written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT  
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A  
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR  
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;  
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
*/
// Nov 20, 2008

package com.sceneworker.editors.trimesheditor;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.concurrent.Callable;

import com.jme.math.Matrix3f;
import com.jme.math.Ray;
import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.TriMesh;
import com.jme.util.GameTaskQueueManager;

public class FrontViewPanel extends OrthoViewPanel {
	
	public FrontViewPanel(TriMesh cl_tm) {
		super(cl_tm);
		
		mcl_eyeDir.z = -1;
		
		mcl_worldToOrthoProjection = new Matrix3f(1f, 0f, 0f,
												0f, -1f, 0f,
												0f, 0f, 0f);
		mcl_orthoToWorldProjection = new Matrix3f(1f, 0f, 0f,
				0f, -1f, 0f,
				0f, 0f, 0f);
	}
	
	protected	void	flipView() {
		mcl_eyeDir.z = -(mcl_eyeDir.z);
	}
	
	
	@Override
	protected	void renderInfo(Graphics2D cl_g) {
		if(mcl_eyeDir.z < 0) {
			cl_g.drawString("front", 5, 10);
		} else {
			cl_g.drawString("back", 5, 10);
		}
		
		cl_g.drawString("+", getWidth() >> 1, 10);
		cl_g.drawString("-", getWidth() >> 1, getHeight() - 10);
		cl_g.drawString("-", 2, getHeight() >> 1);
		cl_g.drawString("+", getWidth() - 10, getHeight() >> 1);
		cl_g.drawString(String.format("view dir %.2f %.2f %.2f", mcl_eyeDir.x, mcl_eyeDir.y, mcl_eyeDir.z), 0, getHeight() - 20);
	}
	
}
